<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>新建目的地 - 蜂窝煤</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="renderer" content="webkit" />

<link href="http://css.mafengwo.net/css/mdd/addpoi.css?1521574026"
	rel="stylesheet" type="text/css" />
<script type="text/javascript">
   function checkname1(){
   var name1=document.getElementById("name1").value;
	    if(name1==""){
	        document.getElementById("label1").innerHTML="<font color='red'>×内容不能为空!</font>";
	        return false;
	    }else{
	        document.getElementById("label1").innerHTML="<font color='green'>√</font>";
	        return true;
	    }
   }
   function checkname2(){
   var name2=document.getElementById("name2").value;
	    if(name2==""){
	        document.getElementById("label2").innerHTML="<font color='red'>×内容不能为空!</font>";
	        return false;
	    }else if(name2!="东北"&&name2!="华北"&&name2!="华中"&&name2!="华东"&&name2!="华南"&&name2!="西南"&&name2!="西北"){
	        document.getElementById("label2").innerHTML="<font color='red'>×区域格式不正确!</font>";
	        return false;
	    }else{
	        document.getElementById("label2").innerHTML="<font color='green'>√</font>";
	        return true;
	    }
   }
   function checkcontent(){
    var content=document.getElementById("content").value;
        if(content==""){
	        document.getElementById("label3").innerHTML="<font color='red'>×内容不能为空!</font>";
	        return false;
	    }else{
	        document.getElementById("label3").innerHTML="<font color='green'>√</font>";
	        return true;
	    }
   }
   function checkall(){
   return checkname1()&&checkname2&&checkcontent();
   }

</script>

</head>
<body>
	<div>
		<jsp:include page="travelhead.jsp"></jsp:include>
	</div>


	<div class="container">
		<div class="row-bg">
			<div class="wrapper">
				<h1>创建新目的地</h1>
				<p>
					感谢你的贡献。如果蜂窝煤已有这个目的地则会无法提交！区域栏只能写东北、华北、华中、华东、华南、西南、西北<span
						class="highlight">*为必填项目</span>
				</p>
			</div>
		</div>
		<div class="wrapper">
			<form action="PlaceServlet?flag=add" method="post"
				enctype="multipart/form-data">

				<div class="form-item">
				<div class="label">
					名称<span class="highlight">＊</span>
				</div>
				<div class="form-content">
					<input style="width:300;height:20;" type="text" id="name1"
						name="name1" onblur="checkname1()"> <label id="label1"></label>
				</div>
				</div>
				<div class="form-item">
				<div class="label">
					所属区域<span class="highlight">＊</span>
				</div>
				<div class="form-content">
					<input style="width:300;height:20;" type="text" id="name2"
						name="name2" onblur="checkname2()"> <label id="label2"></label>
				</div>
				</div>
				<div class="form-item">
					<div class="label">
						介绍<span class="highlight">＊</span>
					</div>
					<div class="form-content">
						<textarea id="content" name="content" rows="3" placeholder="300字以内的目的地简介"
							maxlength="300" onblur="checkcontent()"></textarea>
					</div>
					<div class="form-content"><label id="label3"></label></div>
				</div>
				<div class="form-item">
				请设置风景图：<input type="file" name="myfile" />
				</div>
				<input type="submit" style="width:100;height:30;"
					onclick="return checkall()" value="提交">
			</form>
		</div>
	</div>

	<!-- 尾部 -->
	<div>
	<jsp:include page="about-us.jsp"></jsp:include>
	</div>
</body>
</html>